import { ISelectZmind } from "./type";
import { Zmind } from "./zmind";


class Main {
    constructor() {
        this.init();
    }
    private init() {
        const { innerWidth, innerHeight } = window;
        const div1 = document.createElement('div');
        div1.style.width = String(innerWidth) + 'px';
        div1.style.height = String(innerHeight) + 'px';
        div1.style.backgroundColor = '#f0f0f0';
        document.body.appendChild(div1);

        // const div2 = document.createElement('div');
        // div2.style.width = '500px';
        // div2.style.height = '500px';
        // div2.style.backgroundColor = '#00f0f0';
        // div2.style.position = 'absolute';
        // div2.style.top = '0';
        // div2.style.left = '600px';
        // document.body.appendChild(div2);

        const selectZmind: ISelectZmind = { index: 0 };
        const z = new Zmind(div1, innerWidth, innerHeight, selectZmind, 0);
        // new Zmind(div2, 500, 500, selectZmind, 1);
        window.addEventListener('resize', e => {
            const { innerWidth, innerHeight } = window;
            div1.style.width = String(innerWidth) + 'px';
            div1.style.height = String(innerHeight) + 'px';
            z.setZmindWidthHeight(innerWidth, innerHeight);
        });
    }
}

new Main();